//package com.zxh.zhenxihuan.service.impl;
//
//import com.zxh.zhenxihuan.entity.Users;
//import com.zxh.zhenxihuan.mapper.UserMapper;
//import com.zxh.zhenxihuan.service.UserService;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.Propagation;
//import org.springframework.transaction.annotation.Transactional;
//
//import javax.annotation.Resource;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * @author:geQiang
// * @version:1.0
// * @date:2019/7/24
// * @description:com.zxh.zhenxihuan.service.impl
// */
//@Service("userService")
//public class UsersServiceImpl implements UserService {
//    @Resource
//    private UserMapper userMapper;
//    @Override
//    @Transactional(propagation = Propagation.REQUIRED, timeout = -1, rollbackFor = Exception.class)
//    public Map<String,Object> login(String name, String password) {
//        Map<String,Object> map=new HashMap<>();
//        if(name==null||name.equals("")||password==null||password.equals("")){
//            map.put("error","错误的用户名和密码");
//            map.put("user",null);
//            return map;
//        }
//        Users user=userMapper.login(name,password);
//        if(user==null){
//            map.put("error","错误的用户名和密码");
//            map.put("user",null);
//            return map;
//        }
//        map.put("error",null);
//        map.put("user",user);
//        return map;
//    }
//}
